package com.transactional.manager.web

import com.transactional.manager.bean.vo.IndexVo
import com.transactional.manager.service.IndexService
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.http.ResponseEntity
import org.springframework.web.bind.annotation.PostMapping
import org.springframework.web.bind.annotation.RequestBody
import org.springframework.web.bind.annotation.RestController

@RestController
class IndexController {

    @Autowired
    lateinit var indexService: IndexService

    @PostMapping("/orders")
    fun index(@RequestBody indexVo: IndexVo): ResponseEntity<String> {
        indexService.index(indexVo)
        return ResponseEntity.ok("Success")
    }

}